<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var peopleIndexes = function (arrayes) {
      let ret = [];
      for (let i = 0; i < arrayes.length; i++) {
        let flag = false;
        for (let j = 0; j < arrayes.length; j++) {
          if (i == j) continue;
          if (flag) continue;
          let tmp = new Set(arrayes[i]);
          for (let m = 0; m < arrayes[j].length; m++) {
            tmp.delete(arrayes[j][m]);
          }
          if (tmp.size == 0) {
            flag = true;
          }
        }
        if (!flag) {
          ret.push(i);
        }
      }
      return ret;
    };
    console.log(peopleIndexes(
      [["leetcode", "google", "facebook"],
      ["leetcode", "amazon"],
      ["facebook", "google"]]
    ))
  </script>
</body>

</html>